//
//  String+Extensions.swift
//  ZZY微博
//
//  Created by 庄壮勇 on 2018/2/1.
//  Copyright © 2018年 Personal. All rights reserved.
//

import UIKit

extension String {
    var docDir:String {
        // 1.获取caches目录
        let docDir = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]
        // 2.拼接路径
        return (docDir as NSString).appendingPathComponent(self)
    }
    
    var cacheDir:String {
        // 1.获取caches目录
        let path = NSSearchPathForDirectoriesInDomains(.cachesDirectory, .userDomainMask, true)[0]
        // 2.拼接路径
        return (path as NSString).appendingPathComponent(self)
    }
    
    var tmpDir: String {
        // 1.获取caches目录
        let path = NSTemporaryDirectory()
        // 2.拼接路径
        return (path as NSString).appendingPathComponent(self)
        
    }
}
